package com.entelgy.batch.rege;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.core.io.Resource;

public class CargaContextoTaskLet implements Tasklet{

	private Resource inputResource;
	
	public Resource getInputResource() {
		return inputResource;
	}

	public void setInputResource(Resource inputResource) {
		this.inputResource = inputResource;
	}

	@Override
	public RepeatStatus execute(StepContribution contribution,
			ChunkContext chunkContext) throws Exception {
		
		FiltroCeroDriverUnoHelper fcdu = new FiltroCeroDriverUnoHelper();
		
		ExecutionContext jobExecutionContext = 
				chunkContext.getStepContext().getStepExecution()
				.getJobExecution().getExecutionContext();
		
		jobExecutionContext.put("FILTRO_CERO_DRIVER_UNO", fcdu);
		return null;
	}

}
